<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::group(['namespace'=>'Home'],function (){
    Route::get('login','AuthController@login');
    Route::post('doLogin','AuthController@doLogin');
    Route::get('reg','AuthController@reg');
    Route::post('doReg','AuthController@doReg');
    Route::get('layout','AuthController@layout');
    Route::get('find','AuthController@find');
    Route::post('doFind','AuthController@doFind');


    Route::get('/','IndexController@index');
    Route::get('more','IndexController@more');
    Route::get('newcomer', function () {
        return view('home.newcomer');
    });
    Route::get('alllist','IndexController@alllist');
    Route::get('content/{id}','IndexController@content');
    Route::get('slide','IndexController@slide');
    Route::post('earn','IndexController@earn');

});


Route::group(['namespace' => 'Home', 'middleware' => ['home']], function () {
    Route::get('personal','UserController@personal');
    Route::get('edit','UserController@edit');
    Route::post('edit_post','UserController@edit_post');
    Route::get('jihuo','UserController@jihuo');
    Route::post('jihuo_post','UserController@jihuo_post');
    Route::get('tixian','UserController@tixian');
    Route::post('tixian_post','UserController@tixian_post');
    Route::get('tixian_record','UserController@tixian_record');
    Route::get('team/{id?}','UserController@team');
    Route::get('kefu','UserController@kefu');
    Route::get('mycard','UserController@mycard');
    Route::get('record','UserController@record');
    Route::get('guide','UserController@guide');

});

/**
 * 后台系统
 */
//后台管理系统
Route::group(['namespace' => 'Admin', 'prefix' => 'admin'], function () {
    //注册 登录
    Route::get('login',     'Auth\AuthController@login')->name('login');
    Route::post('login',    'Auth\AuthController@doLogin');
    Route::get('logout',    'Auth\AuthController@getlogout');
    Route::get('password_edit', 'Auth\AuthController@password_edit');
    Route::post('password_edit', 'Auth\AuthController@password_update');
    Route::any('/upload_img', 'FileController@upload_img'); //上传图片

});


Route::group(['namespace' => 'Admin', 'prefix' => 'admin','middleware' => ['admin']], function () {
    //Route::get('/dashboard', 'AdminController@index'); //后台首页
    Route::any('/delimg','FileController@delimg');

    //Route::any('/index', 'AdminController@index'); //后台首页
    //Route::get('/info/index','AdminController@admininfo');//管理员资料
    //Route::get('/usermember/index','AdminController@usermembershow');//用户管理界面
    //Route::get('/article/index','AdminController@articleshow');//已发文章界面
    //Route::get('/article/show','AdminController@uploadarticle');//创建文章

    Route::any('/index', 'UserController@index'); //后台首页
    //管理员管理
    Route::any('aduser/index','AdUserController@index');
    Route::get('aduser/add','AdUserController@add');
    Route::post('aduser/add_post','AdUserController@add_post');
    Route::get('aduser/edit/{id}','AdUserController@edit');
    Route::post('aduser/edit_post','AdUserController@edit_post');
    Route::post('aduser/delete/{id}','AdUserController@delete');

    //会员管理
    Route::any('user/index','UserController@index');
    Route::get('user/add','UserController@add');
    Route::post('user/add_post','UserController@add_post');
    Route::get('user/edit/{id}','UserController@edit');
    Route::post('user/edit_post','UserController@edit_post');
    Route::post('user/delete/{id}','UserController@delete');


    //轮播图管理
    Route::any('grid/index','GridController@index');
    Route::get('grid/add','GridController@add');
    Route::post('grid/add_post','GridController@add_post');
    Route::get('grid/edit/{id}','GridController@edit');
    Route::post('grid/edit_post','GridController@edit_post');
    Route::post('grid/delete/{id}','GridController@delete');
    Route::get('grid/up_down','GridController@up_down');

    //产品管理
    Route::any('goods/index','GoodsController@index');
    Route::get('goods/add','GoodsController@add');
    Route::post('goods/add_post','GoodsController@add_post');
    Route::get('goods/edit/{id}','GoodsController@edit');
    Route::get('goods/show/{id}','GoodsController@show');
    Route::post('goods/edit_post','GoodsController@edit_post');
    Route::post('goods/delete/{id}','GoodsController@delete');
    Route::get('goods/up_down','GoodsController@up_down');



    //提现管理
    Route::any('tixian/index','TixianController@index');
    Route::get('tixian/up_down','TixianController@up_down');

    //激活码管理
    Route::any('code/index','CodeController@index');
    Route::get('code/add','CodeController@add');
    Route::post('code/add_post','CodeController@add_post');
    Route::post('code/delete/{id}','CodeController@delete');
    Route::get('code/up_down','CodeController@up_down');


});

